from pyspark import SparkConf, SparkContext
import os

# 设置环境变量PYSPARK_PYTHON， 告诉spark去哪里找到python.exe
os.environ['PYSPARK_PYTHON'] = "D:/soft/python312/python.exe"

# 创建SparkConf 对象
spark_conf = SparkConf().setMaster(value="local[*]").setAppName("test_spark")

# 创建sparkContext对象
sc = SparkContext(conf=spark_conf)

rdd = sc.parallelize([1, 2, 3, 4, 5])


def func(data):
    return data * 10


rdd2 = rdd.map(func)



sc.stop()
